package org.example;

/**
 * @author ycd
 */
public class ProblemOne {
    //这里可能用BigDecimal更合适，为了方便用double
    public static final double APPLE_PRICE = 8.0; // 苹果价格（元/斤）
    public static final double STRAWBERRY_PRICE = 13.0; // 草莓价格（元/斤）
    public static double calculateTotalPrice(int appleNum, int strawberryNum) {
        // 计算苹果总价
        double appleTotal = appleNum * APPLE_PRICE;
        // 计算草莓总价
        double strawberryTotal = strawberryNum * STRAWBERRY_PRICE;
        // 计算总金额
        double total = appleTotal + strawberryTotal;
        return total;
    }

    public static void main(String[] args) {
        // 测试顾客购买了3斤苹果和2斤草莓
        int appleNum = 3;
        int strawberryNum = 2;
        double totalPrice = calculateTotalPrice(appleNum, strawberryNum);
        System.out.printf("顾客A购买的水果总价为 %.2f 元。\n", totalPrice);
    }

}